package com.sing.controller;

import com.sing.CommonResponse;
import com.sing.entity.Article;
import com.sing.entity.User;
import com.sing.manager.TestManager;
import com.sing.until.DateFormatUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by yinhuachang on 2018/4/8.
 */
@RestController
public class TestController {
    private static final Logger logger = LoggerFactory.getLogger(TestController.class);
    @Autowired
    private TestManager testManager;

    /**
     *1111
     * @return
     */
    @GetMapping(value = "test")
    public CommonResponse testdemo(){
        String date=DateFormatUtil.getCurrentDate();
        Article article =testManager.getUser(1);
        logger.info("date-->"+date+":"+article.getContent());
        return CommonResponse.success("日期"+date+":"+article.getContent());
    }



}
